{% extends "base_generic.html" %}

{% block content %}
<h2>借阅排行榜</h2>
<div class="list-group">
    {% for book in book_list %}
    <div class="list-group-item d-flex justify-content-between align-items-center">
        <div>
            <h5 class="mb-1"><a href="{% url 'book-detail' book.id %}">{{ book.title }}</a></h5>
            <p class="mb-1">作者: {{ book.author }}</p>
        </div>
        <span class="badge bg-primary rounded-pill">借阅次数: {{ book.borrow_count }}</span>
    </div>
    {% empty %}
    <p>暂无借阅数据。</p>
    {% endfor %}
</div>
{% endblock %}